package com.sense.kukoo.biz_messages.adapter

import com.sense.kukoo.biz_messages.adapter.provider.*
import com.sense.kukoo.common.repo.biz.MessagesItemBean
import com.sense.kukoo.common.wiget.adapter.MultiItemAdapter

class MessagesItemAdapter(

    val data: List<MessagesItemBean>,
    val listener: MessagesItemListener,

): MultiItemAdapter<MessagesItemBean>(data) {

    interface MessagesItemListener{
        fun onViewMore(data: MessagesItemBean)
        fun onDeleteItem(data: MessagesItemBean)
        fun onClickMusic(data: MessagesItemBean)
        fun onClickChannel(data: MessagesItemBean)
        fun onClickFollow(data: MessagesItemBean)
    }

    init {
        addItemProvider(LikeMessagesItemProvider(listener))
        addItemProvider(FollowersMessagesItemProvider(listener))
        addItemProvider(CommentsMessagesItemProvider(listener))
        addItemProvider(SystemsMessagesItemProvider(listener))
        addItemProvider(ViewMoreMessagesItemProvider(listener))
        addItemProvider(EmptyMessagesItemProvider(listener))
    }

    override fun getItemType(data: MutableList<MessagesItemBean>, position: Int): Int {
        return data.get(position).type
    }
}